<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

<script>
let value = 'thelongestday.yhf@gmail.com';
let regCode=/^[\w\.]+@\w+\.[a-zA-Z]{2,3}(\.[a-zA-Z]{2,3})?$/;
console.log("email是否正确："+regCode.test(value));
let arrays = regCode.exec(value);
console.log(arrays);
let string = "a bat, a cat, a fAt baT, a faT cat"; 
let tempString = string.replace(/at/gi,'et');
console.log(tempString);
</script>